home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 020a / rmastr02.zip / DEMO4.PAS < prev    next >
Pascal/Delphi Source File  |  1991-09-22  |  2KB  |  53 lines

  1. (*
  2.  
  3.    ----------------------------------------------------------
  4.    WriteDef procedure                                    RWDef
  5.    ----------------------------------------------------------
  6.  
  7.    Function   : Save an area of the screen as a DEF file.
  8.  
  9.    Decloration: WriteDef(Filename : String; X1,Y1,X2,Y2 : Word)
  10.  
  11.    Remarks    : I/O checking is NOT performed.
  12.                 This method of saving an Image is not very
  13.                 efficient, but the format is simple. The
  14.                 Image is saved as a Text file, you can
  15.                 load it into your regular text editor
  16.                 and look at it with no problems. Each pixel's
  17.                 color is represented by a HEX degit. The following
  18.                 is a white box with a black arrow in the centre.
  19.  
  20.  
  21.                 FFFFFFFFFF
  22.                 FFF0FFFFFF
  23.                 FF0FFFFFFF
  24.                 F00000000F
  25.                 FF0FFFFFFF
  26.                 FFF0FFFFFF
  27.                 FFFFFFFFFF
  28.  
  29. *)
  30.  
  31.  
  32. Program Demo4;
  33.  Uses Graph,RWDEF;
  34. Var
  35.  Gd   : Integer;
  36.  Gm   : Integer;
  37. Begin
  38.  Gd:=EGA;
  39.  Gm:=EGAhi;
  40.  InitGraph(Gd,Gm,'');
  41.                                            (* Draw something *)
  42.  SetFillStyle(XhatchFill,Blue);
  43.  Bar(0,0,30,30);
  44.  SetFillStyle(SolidFill,LightRed);
  45.  Bar(20,20,40,40);
  46.  
  47.  
  48.  WriteDef('BOX2.DEF',0,0,40,40);           (* Save Image as DEF file *)
  49.  
  50.  ReadLn;                                   (* Wait for Enter Key *)
  51.  
  52.  CloseGraph;                               (* Close graphics *)
  53. End.